<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li class="completed" v-for="item in list" :key="item.id">
      <div class="view">
        <input class="toggle" type="checkbox" v-model="item.isDone"/>
        <label :class="item.isDone ? '' : 'done'">{{item.name}}</label>
        <button class="destroy" @click="del(item.id)"></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    list: {
      type: Array
    }
  },
  data () {
    return {}
  },
  methods: {
    del (id) {
      this.$emit('del', id)
    }
  },
  computed: {},
  watch: {},
  filters: {},
  components: {},
  created () {},
  mounted () {}
}
</script>

<style scoped lang='less'>
.done {
  color: #111 !important;
  text-decoration:none !important
}
</style>
